Replace IdentityServer4 with OpenIddict and upgrade to .net 9#28
Open
juliangiebel wants to merge 35 commits intospace-wizards:masterfrom
Open
Replace IdentityServer4 with OpenIddict and upgrade to .net 9#28juliangiebel wants to merge 35 commits intospace-wizards:masterfrom
juliangiebel wants to merge 35 commits intospace-wizards:masterfrom
Conversation
Upgrade nuget packages Fix npgsql errors from upgrade Note: (IpAddress, int) is now NpgsqlCidr
Migrate to nullable
This reverts commit 7b0520a.
Implement unit tests for multiple secret handling methods
Implement custom url validator
Work on admin oauth app settings page
Implement legacy token handling test
|
|
||
| var certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddYears(10)); | ||
|
|
||
| File.WriteAllBytes("server-encryption-certificate.pfx", certificate.Export(X509ContentType.Pfx, string.Empty)); |
Member
There was a problem hiding this comment.
Might want to add a check if any of these files exist and throw hard, so we don't accidentally the certs.
Member
There was a problem hiding this comment.
Considering this tool will be ran once I doubt it's really an issue. I guess it's quick though fo code just in case.
VasilisThePikachu
approved these changes
Nov 23, 2025
Member
There was a problem hiding this comment.
Lowercase SQL is a crime
VasilisThePikachu
suggested changes
Nov 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
!!!This PR was locally tested extensively. It should still be tested with different oauth clients used in production though. Esp. the wiki as it can potentially break those oauth clients/application. Ideally upgrading SS14.Web is tested on a separate instance created from a snapshot first!!!
This PR updates the project to .net 9 and replaces IdentityServer4 with OpenIddict while trying to ensure that existing OAuth applications keep working. For that purpose there is a data migration sql script under
tools/identityserver4_to_openiddict_data_migration.sql.Differences between IdentityServer4 and OpenIddict
The biggest difference between the two OIDC solutions is the way client/applications are stored and the amount of extra features and settings.
OpenIddict uses a lot less database entities to store applications as it stores most non queried settings and configurations as json inside the application entity. It also doesn't normalize entities to quite the extent IS4 does.
This means there wasn't a need for a separate schema.
Also a lot of settings that weren't used got removed from the UI as implementing them with OpenIddict would mean adding custom settings and implementing custom event handlers (Which this PR already does for settings that had to be re-implemented like "PlainPkce" and "Allow PS256")
Encryption and Signing keys have to be supplied as certificates using PFX files.
OpenIddict also uses a different hashing algorithm for secrets and it salts them so migrated keys from IS4 are marked as legacy and handled seperatly using a re-implementation of the the way secrets are hashed in IS4 (Which uses standard .net cryptography methods).
Additional changes
Program.csandStartup.csforSS14.Web/SS14.Webinto a single top leverProgram.csfile.#nullable true.Noteworthy improvements
/.well-known/openid-configurationnow only lists actually supported capabilities and featuresuserinfoendpointGenerating encryption and signing certificates
At least one encryption and one signing certificate needs to be generated and configured for each encryption/signing algorithm that needs to be supported.
For this purpose a csx file exists under
tools\GenerateCerts.csx(I used the .net10 preview to execute it otherwise it needs a proper project file).Executing that file will generate 3 certificates. One encryption certificate using RS265 and two signing certificates using RS265 and PS265 respectively.
Example certificate configuration
Fixes #20
Fixes #17